import Vue from 'vue';
import Vuex from 'vuex';
import {getCookie} from "../assets/js/utils";
Vue.use(Vuex);
var cook={};
if(getCookie("user")){
  cook=JSON.parse(getCookie("user"));
}

const state={
    nickName:cook?unescape(cook.u_name):'',
    nickId:cook?cook.u_id:'',
    nickAva:cook?cook.u_ava:'',
    nickState:null,
    imgPath:'http://192.168.103:6060',
    myname:"中",
}
const mutations={
    updateUserInfo(state,nickName){
      state.nickName=nickName;
    },
    changeName(state,myname){
      state.myname=myname
    },
};

export default new Vuex.Store({
  state,
  mutations
});
